<%@ page language="java" import="java.util.*,com.hs.core.utils.*" pageEncoding="utf-8"%>
<%
  String treedata = (String)request.getAttribute("treedata");

 %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html >
<head> 
<%@ include file="../../include.jsp"%> 
<script src='<%=basePath%>thirtpart/jquery/jquery.blockUI.js'></script> 
<script src='<%=basePath%>app/js/hs.search.js'></script> 


<link rel="stylesheet" href="<%=basePath %>thirtpart/ztree3.5/css/zTreeStyle/zTreeStyle.css" type="text/css"/>
<script type="text/javascript" src="<%=basePath %>thirtpart/ztree3.5/js/jquery.ztree.core-3.5.min.js"></script>
<script type="text/javascript" src="<%=basePath %>thirtpart/ztree3.5/js/jquery.ztree.excheck-3.5.min.js"></script>
<style>.tac{text-align:center}</style>
<SCRIPT type="text/javascript">
		<!--
		var setting = {
			check: {
				enable: true
			}, 
			view: {
				showIcon: showIconForTree
			},
			data: {
				simpleData: {
					enable: true
				}
			}
			 ,
			callback: {
		         onCheck: zTreeOnCheck,
		         onClick: zTreeOnClick 
	        }
 		};
 		
 		function zTreeOnCheck(event, treeId, treeNode) {
   			 //alert(treeNode.id + ", " + treeNode.name + "," + treeNode.checked);
   			// window.parent.summindex.setHiddenDisname(treeNode.id,treeNode.name);
   			 //var treeObj = $.fn.zTree.getZTreeObj("tree");
			 //var nodes = treeObj.getCheckedNodes(true);
			  viewContent(treeNode.id);
		};
		function zTreeOnClick(event, treeId, treeNode){
				//var treeObj = $.fn.zTree.getZTreeObj("treeboxbox_tree");
                viewContent(treeNode.id);
			//alert(treeNode.tId + ", " + treeNode.name + "," + treeNode.checked);
		} 
		var zNodes =[
			<%=treedata%>
		];
		function showIconForTree(treeId, treeNode) {
			return !treeNode.isParent;
		};
		function viewContent(itemId) {  
			var treeObj = $.fn.zTree.getZTreeObj("treeboxbox_tree");
			var nodes = treeObj.getCheckedNodes(true);
            var idstr = "";
            if(nodes.length > 0){
            	for(var i=0;i<nodes.length;i++){
            		var id = nodes[i].id;
            		idstr += id;
            		if(i != nodes.length-1){
            			idstr+=',';
            		}
            	}
            	
            } 
     		window.parent.subpage.frameElement.src="<%=basePath%>stat/statindex.do?pidstr="+idstr;
   			// window.parent.frames["subpage"].src=url;
   			// obj.document.location.relaod();
        }
		$(document).ready(function(){
			$.fn.zTree.init($("#treeboxbox_tree"), setting, zNodes);
			var treeObj = $.fn.zTree.getZTreeObj("treeboxbox_tree"); 
			treeObj.expandAll(true); 

		});
		//-->
	</SCRIPT>
</head>
<body>
<dl class="treeWrap">
    <dt> </dt> 
    <dd>
       	<div id="treeboxbox_tree" class="ztree" style="width:95%;margin-left:10px;overflow:auto;border:0px solid #bdc0c3;"></div>   
    </dd> 
</dl> 
</body>
</html>
 

